package hotel.compare.oversea.mapper.master;


import hotel.base.oversea.dto.master.CompareHotelBasicRoomDto;
import hotel.base.oversea.entity.MtHotelRoomVo;
import hotel.base.oversea.entity.master.CompareHotelBasicRoom;
import hotel.base.oversea.repository.MyMapper;
import hotel.compare.oversea.entity.master.CompareHotelRoomBySql;
import hotel.compare.oversea.entity.meituan.MtHotelRoom;
import hotel.compare.oversea.entity.switchs.SwitchBasicRoomType;
import hotel.compare.oversea.vo.CompareHotelRoomVo;
import hotel.compare.oversea.vo.GetRoomListVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @Author lmf
 * @Date 2020/5/29 15:30
 **/
public interface CompareHotelBasicRoomMapper extends MyMapper<CompareHotelBasicRoom> {
    /**
     * 根据母物理房型和母酒店id 获取美团id
     *
     * @param masterHotelId
     * @param roomId
     * @return
     */
    MtHotelRoomVo getCompareHotelInfo(@Param("masterHotelId") Integer masterHotelId, @Param("roomId") Integer roomId);

    /**
     * 获取校验后酒店房型信息
     *
     * @param
     * @return hotel.base.oversea.utils.Result<java.lang.Object>
     * @author HuangT
     * @date 2020/6/30 17:29
     */
    CompareHotelBasicRoomDto getHotelBasicRoomInfo();

    /**
     * <H1>更新数据库创建状态字段</H1>
     *
     * @param hotelBasicRoomDto
     * @return void
     * @author HuangT
     * @date 2020/7/1 18:12
     */
    void updateCreateStateById(CompareHotelBasicRoomDto hotelBasicRoomDto);
    /**
     * 根据携程母物理房型id 美团物理房型id 获取效验房型记录信息
     * @param switchRoomId
     * @param mtRoomId
     * @return
     */
    CompareHotelBasicRoom getCompareHotelBasicRoomInfo(@Param("swithcHotelRoomId") int switchRoomId, @Param("mtHotelRoomId") int mtRoomId);

    /**
     * @author: lmf
     * @date: 2020/8/21 20:27
     * 获取携程未效验的房型列表
     */
    List<SwitchBasicRoomType> getNoMatchSwitchRoom(@Param("masterHotelId") Integer masterHotelId);

    /**
     * @author: lmf
     * @date: 2020/8/21 20:26
     * 获取美团的未效验的房型列表
     */
    List<MtHotelRoom> getNoMatchMtRoom(@Param("mtHotelId") String mtHotelId);
    /**
     * @author: lmf
     * @date: 2020/8/26 6:39
     * 获取效验房型数据
     */
    Integer isExists(@Param("masterHotelId") Integer masterHotelId);
    /**
     * @author: lmf
     * @date: 2020/9/16 11:44
     * 获取已匹配的房型列表
     */
    List<CompareHotelRoomVo> getCompareRoomList(GetRoomListVO getRoomListVO);
    /**
     * @author: lmf
     * @date: 2020/9/16 14:35
     * 获取未匹配的房型列表
     */
    List<CompareHotelRoomVo> getNoCompareRoomList(GetRoomListVO getRoomListVO);
    /**
     * @author: lmf
     * @date: 2020/9/16 15:35
     */
    List<CompareHotelRoomVo> getMtNoCompareList(@Param("masterHotelId") Integer masterHotelId);
    /**
     * @author: lmf
     * @date: 2020/9/17 14:19
     * 判断是否存在效验表中，存在就不保存
     */
    int selectMtHotelIdAndMtHotelRoomIdAndHotelIdAndRoomId(@Param("mtHotelId") String mtHotelId, @Param("mtHotelRoomId") String mtHotelRoomId, @Param("switchHotelId") Integer switchHotelId, @Param("switchHotelRoomId") String switchHotelRoomId);
    /**
     * @author: lmf
     * @date: 2020/9/17 14:26
     * 判断是否酒店+房型id 是否有对应的记录
     */
    int selectHotelIdAndRoomId(@Param("switchHotelId") Integer switchHotelId, @Param("switchHotelRoomId") String switchHotelRoomId);
    /**
     * @author: lmf
     * @date: 2020/9/19 16:30
     * 根据携程的母酒店id + 母物理房型id 获取到美团对应的酒店id+ 房型id
     */
    CompareHotelBasicRoom getHotelRoomInfo(@Param("switchHotelId") int masterHotelId, @Param("switchRoomId") int roomId);
    /***
     * @Author: lmf
     *@Date: 2020/9/28
     * 根据sql匹配房型数据
     */
    List<CompareHotelRoomBySql> getCompareHotelRoomList();
    /***
     * @Author: lmf
     *@Date: 2020/9/28
     * 根据sql匹配房型数据 100%匹配
     */
    List<CompareHotelRoomBySql> getCompareHotelRoomListAndTen();

    /***
     * @Author: lmf
     *@Date: 2020/11/19
     * 根据sql匹配房型数据 100%匹配
     */
    List<CompareHotelRoomBySql> getCompareHotelRoomListByCompareSimilarByMthotelId(@Param("mtHotelId") Integer mtHotelId);
    /***
     * @Author: lmf
     * @Date: 2020/9/28
     *
     */
    CompareHotelBasicRoom selectByRoomIdAndMtRoomId(@Param("mtHotelId") Integer mtHotelId, @Param("mtRoomId") Integer mtRoomId, @Param("hotelId") Integer hotelId, @Param("masterBasicRoomId") Integer masterBasicRoomId);
    /***
     * @Author: lmf
     * @Date: 2020/9/28
     * 删除重复数据
     */
    void deleteByDouble();

    /**
     * 根据携程物理房型id+美团的房型id 获取是否有效验数据
     * @param switchRoomId
     * @param mtRoomId
     * @return
     */
    CompareHotelBasicRoom getHotelRoomInfoBySwitchRoomIdAndMtRoomId(@Param("switchRoomId") int switchRoomId, @Param("mtRoomId") int mtRoomId);

    /**
     * 根据美团酒店id+美团物理房型id 获取是否有效验数据
     * @param mtHotelId
     * @param mtRoomId
     * @return
     */
    CompareHotelBasicRoom getHotelRoomInfoByMtHotelIdAndMtRoomId(@Param("mtHotelId") int mtHotelId, @Param("mtRoomId") int mtRoomId);
    /**
     * 根据美团酒店id+美团物理房型id 删除效验数据
     * @param mtHotelId
     * @param mtRoomId
     * @return
     */
    int removeHotelRoomInfoByMtHotelIdAndMtRoomId(@Param("mtHotelId") int mtHotelId, @Param("mtRoomId") int mtRoomId);
    /***
    * @Author: lmf
    * @Date: 2021/1/13
     * 获取没有创建房型数据的酒店房型数据
    */
    List<Integer> selectNoCreateBasicRoom(@Param("hotelId") Integer hotelId);
    /***
    * @Author: lmf
    * @Date: 2021/1/25
     * 更新效验表的创建状态
    */
    Integer updateHotelBasicRoomState(List<Integer> id);
    /***
    * @Author: lmf
    * @Date: 2021/1/25
     * 批量更新效验房型的效验状态
    */
    int updateBatch(List<Integer> roomIds);
    /***
    * @Author: lmf
    * @Date: 2021/2/3
     * 根据携程的酒店id+携程的母物理房型id
    */
    CompareHotelBasicRoom getHotelRoomInfoByHotelIdAndRoomId(@Param("hotelId") int hotelId, @Param("masterBaiscRoomId") int masterBaiscRoomId);
    /***
    * @Author: lmf
    * @Date: 2021/2/3
     * 根据携程的酒店+携程的母物理房型id
    */
    int removeHotelRoomInfoByHotelIdAndRoomId(@Param("hotelId") int hotelId, @Param("masterBaiscRoomId") int masterBaiscRoomId);
}
